﻿using System;
using System.IO;
using System.Xml.Linq;
using System.Diagnostics;


namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            //XElement root = new XElement("Config");
            //XElement info = new XElement("Info");
            //info.SetElementValue("Version", "1.0");
            //root.Add(info);
            //root.Save("test.xml");

            Stopwatch sw = new Stopwatch();
            sw.Start();

            //开始计时

            //XDocument document = XDocument.Load("https://raw.githubusercontent.com/KatyushaScarlet/test/master/ConsoleApp1/online-config.xml");.
            XDocument document = XDocument.Load("https://gitee.com/KatyushaScarlet/test/raw/master/ConsoleApp1/online-config.xml");
            XElement root = document.Root;
            XElement info = root.Element("Info");
            XElement version = info.Element("Version");
            sw.Stop();

            //结束计时

            double versionInfo = Convert.ToDouble(version.Value);
            Console.WriteLine("Version:" + versionInfo);
            Console.WriteLine("Use:" + sw.ElapsedMilliseconds);
            Console.ReadKey();
        }
    }
}
